package com.zengde.ai_sandbox.service.impl;

import com.zengde.ai_sandbox.annonation.LogAround;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    // 贴上我们自定义的“贴纸”
    @LogAround("这是一个根据ID查找用户的方法")
    public User findUserById(Long id, String client) {
        // 模拟业务逻辑
        User user = new User();
        user.setId(id);
        user.setName("User-" + id);
        user.setClient(client);
        return user;
    }
}

// 简单的User类

class User {
    private Long id;
    private String name;
    private String client;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getClient() {
        return client;
    }

    public void setClient(String client) {
        this.client = client;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", client='" + client + '\'' +
                '}';
    }
}
